home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2004 #6
/
Amiga Plus CD - 2004 - No. 06.iso
/
AmigaPlus
/
Begleitmaterial
/
50Tools
/
Grafik
/
PerfectPaint
/
KATalysator
/
KATalysator.rx
Wrap
Text File
|
2002-09-28
|
32KB
|
1,456 lines
/*
KATalysator © by Saint & Antibike
==========================
$VER: KATalysator 1.0pre (01.10.02)
*/
/*Prepare the Work*/
/******************/
addlib("rexxsupport.library",0,-30,0)
Options results
parse ARG Port b
ADDRESS value Port
call init()
call loadprefs()
call opengui()
call SavePrefs("KATalysator",dir,sdir,thsf,thqual,thmax,thxsize,thysize,vbsf,vbqual,vbmax,xsize,ysize,rotate,thali,thflipx,thsmooth,thflipy,vbali,vbflipx,vbsmooth,vbflipy,brush,BrushF,ppz,ThImgB,tborder,htmid,vbimgb,httop,htbot,rekursiv,thactive,vbactive,ZpS,ThCo,VbCo,muster)
checkHtmlFiles()
/*Sorted List for OS3.5+ List*/
/*****************************/
ADDRESS COMMAND "Version C:List >t:VLs"
open(V,"t:VLs",r)
Version=readln(V)
close(c)
if substr(Version,6,2)>41 then DO
sort=" Sort=N "
END
ELSE DO
Sort=" "
END
say "source =" sdir
say "dest = " dir
/*List and count Pics*/
/*********************/
if rekursiv=1 THEN DO
ADDRESS COMMAND 'C:List "' || sdir || Muster || '" all files LFORMAT=%F%N ' || Sort || ' >t:Liste'
END
ELSE DO
ADDRESS COMMAND 'C:List "' || sdir || Muster || '" files LFORMAT=%F%N ' || Sort || ' >t:Liste'
END
bilder=countlines("T:Liste")
if bilder=0 then do
pp_permitrefresh
exit
END
open(names,"T:Liste",r)
/*Percent?*/
/**********/
if pos("%",thxsize)~=0 then do
thxsize=seekrep(thxsize,"%"," ")
thxsize=compress(thxsize)
thxperc=1
END
if pos("%",thysize)~=0 then do
thysize=seekrep(thysize,"%"," ")
thysize=compress(thysize)
thyperc=1
END
if pos("%",xsize)~=0 then do
xsize=seekrep(xsize,"%"," ")
xsize=compress(xsize)
percx=1
END
if pos("%",ysize)~=0 then do
ysize=seekrep(ysize,"%"," ")
ysize=compress(ysize)
percy=1
END
if Brush~=1 then DO
IBrush=BrushInit(BrushF)
END
stellen=length(bilder)
getcurrentbuffer
alterpuffer=result
i=1 /*Nur richtige Bilder*/
counter=1 /*Alle Files*/
/*Allready an Index there?*/
/**************************/
if exists(dir || "index.html") THEN DO
pp_Multirequest "KATalysator*©*by*Saint&Antibike" "index.html*allready*exists!" "Overwrite|Quit"
choice=result
if choice=0 then do
EXIT
END
END
/*Open the Index*/
/****************/
indexinit(ppz,tborder,thimgb,thxsize,thysize,xsize,ysize,name,dir,0,httop,"Write",stellen)
/*Let`s rock!*/
/*************/
Do while ~eof(names)
i=right(i,stellen,"0")
name=seekrep(readln(names),"Ram Disk:","Ram:")
setclip("counter",counter)
setclip("bilder",bilder)
prog(" ")
tmp=PreProgress(buffer,name,rotate)
say "tmp=" tmp
if tmp~=0 Then DO /*Nur wenn Bild geladen ist weitermachen*/
Parse Var tmp,h";"w";"d
ret=ProgressTh(ThFlipX,ThFlipY,W,H,D,ThMax,ThXperc,ThYperc,ThXSize,ThYSize,ThSf,dir,ppz,TBorder,ThImgB,Name,I,Stellen,ThAli,XSize,YSize,Buffer,thsmooth,thqual,Percx,Percy,VBMax,thActive,ThCo)
Call ProgressVb(PercX,PercY,XSize,YSize,VBMax,W,H,D,Brush,IBrush,VBSmooth,Dir,I,VBQual,VBSf,PPZ,TBorder,VBImgB,Name,HtMid,Stellen,VBAli,Buffer,Vbflipx,vbflipy,bilder,counter,vbActive,VbCo)
i=right(i+ret,stellen,0)
counter=counter+1
END
END
/*Clean up*/
/**********/
indexinit(ppz,tborder,thimgb,thxsize,thysize,xsize,ysize,name,dir,i,htbot,"APPEND",stellen)
pp_clearbuffer buffer
pp_setbuffer alterpuffer
pp_Progresstext ""
pp_clearprogress
exit
/****/
ThsizeInit:
/*Calculate Thumbnail Size*/
/**************************/
if thxPerc=1 then thXSize=(w*thxSize/100)
if thyPerc=1 then thySize=(h*thySize/100)
if thMax=1 then DO
num1=w/thxsize
num2=h/thysize
if w>thxsize | h>thysize then do
if num1>num2 then thysize=h/num1
if num1<num2 then thxsize=w/num2
END
ELSE DO /*Bilder NICHT Hochskalieren!*/
thxsize=w
thysize=h
END
END
thxsize=trunc(thxsize,0)
thysize=trunc(thysize,0)
return 0
VbSizeInit:
/*Calculate Image Size*/
/**********************/
if Percx=1 then XSize=(w*xSize/100)
if Percy=1 then ySize=(h*ySize/100)
if VbMax=1 then DO
num1=w/xsize
num2=h/ysize
if w>xsize | h>ysize then do
if num1>num2 then ysize=h/num1
if num1<num2 then xsize=w/num2
END
ELSE DO /*Do NOT UpScale!*/
xsize=w
ysize=h
END
END
xsize=trunc(xsize,0)
ysize=trunc(ysize,0) /*Trunc for the HTML Size*/
return 0
PreProgress: Procedure
/*ForEach...*/
/************/
buffer=arg(1)
name=arg(2)
rotate=arg(3)
pp_setbuffer Buffer /*Set to empty Buffer*/
prog("Loading...")
if name="" then Return 0 /*Couldn`t load Picture*/
else do
result=ppload(name)
PARSE VAR result,h";"w";"d
end
say "Breite=" w
if w="0" then Return 0 /*Couldn`t load Picture*/
DO while rotate~=0
prog("Rotating...")
pp_rot90
rotate=rotate-1
tmp=w
w=h
h=tmp
END
say "progress:"
say "w;h;d;=" w";"h";"d
return h";"w";"d
ProgressTh: Procedure
/*Processing Thumbnail*/
/**********************/
ThFlipX=Arg(1)
ThFlipY=Arg(2)
W =Arg(3)
H =Arg(4)
D =Arg(5)
ThMax =Arg(6)
ThXperc=Arg(7)
ThYperc=Arg(8)
ThXSize=Arg(9)
ThYSize=Arg(10)
ThSf =Arg(11)
dir =Arg(12)
PPZ =Arg(13)
TBorder=Arg(14)
ThImgB =Arg(15)
Name =Arg(16)
I =Arg(17)
Stellen=Arg(18)
ThAli =Arg(19)
XSize =Arg(20)
YSize =Arg(21)
Buffer =Arg(22)
thsmooth=arg(23)
thQual =Arg(24)
PercX =Arg(25)
PercY =Arg(26)
VBMax =Arg(27)
thActive=Arg(28)
ThCo =Arg(29)
say "Thumb bit = " ThCo
call ThsizeInit() /*Calculate the Size (no Procedures)*/
call VbSizeInit()
if thActive=1 then DO /*Größe wird trotzdem für den Index benötigt*/
if Thali=1 then pp_AliasOn
ELSE pp_AliasOff
pp_FindEmptyBuffer
thBuffer=result
if thBuffer=-1 then DO
pp_Warn "can't*find*empty|Buffer."
EXIT
END
if d~=24 then DO
pp_convert2rgb
d=24
END
say "w = " w
say "thxsize=" thxsize
say "Größen: " thxsize thysize
if w~=thxsize | h~=thysize then DO
prog("Scaling...")
scale(Buffer,thBuffer,w,h,d,thxsize,thysize)
END
if ThFlipx=1 then DO
prog("Flip*x...")
pp_FlipX
ENd
if ThFlipy=1 then DO
prog("Flip*y...")
pp_Flipy
END
if thsmooth=1 then DO
prog("Smoothing...")
smooth(thxsize,thysize)
END
prog("Saving...")
If ThCo ~=9 then do /*Dithering*/
dither(ThCo,thXsize,thYsize)
END
ThSf=save(dir,"th" || i,thqual,ThSf,name)
pp_clearbuffer thbuffer
pp_setbuffer Buffer
END /*if ThActive=1*/
prog("Indexing...")
format.0=".jpg"
format.1=".png"
format.2=".gif"
format.3=".iff"
indexmake(ppz,tborder,ThImgB,thxsize,thysize,xsize,ysize,name,dir,i,stellen,format.ThSf,thActive)
return 1 /*Succeded*/
ProgressVb: Procedure
/*Processing Fullsize Images*/
/****************************/
PercX =Arg(1)
PercY =Arg(2)
XSize =Arg(3)
YSize =Arg(4)
VBMax =Arg(5)
W =Arg(6)
H =Arg(7)
D =Arg(8)
Brush =Arg(9)
IBrush =Arg(10)
VBSmooth =Arg(11)
Dir =Arg(12)
I =Arg(13)
VBQual =Arg(14)
VBSf =Arg(15)
PPZ =Arg(16)
TBorder=Arg(17)
VBImgB =Arg(18)
Name =Arg(19)
HtMid =Arg(20)
Stellen=Arg(21)
VbAli =Arg(22)
Buffer =Arg(23)
VbFlipX=Arg(24)
VbFlipY=Arg(25)
gesamt =Arg(26)
counter=Arg(27)
vbActive=Arg(28)
VbCo =Arg(29)
call VbsizeInit()
/*Call ThSizeInit() /*Still important for HTML Sizes*/*/
if VbActive=1 then DO
if VbAli=1 then pp_AliasOn
ELSE pp_AliasOff
if w~=xsize | h~=ysize then DO
prog("Scaling...")
pp_ScalePicture xsize ysize
END
if VbFlipx=1 then DO
prog("Flip*x...")
pp_FlipX
ENd
if VbFlipy=1 then DO
prog("Flip*y...")
pp_Flipy
END
say "Brush="Brush
if Brush~=1 then do
prog("Brush...")
Brushplot(IBrush,brush,xsize,ysize) /*IBrush *g*/
END
say "smooth=" vbsmooth
if vbsmooth=1 then DO
prog("Smoothing")
smooth(xsize,ysize)
END
prog("Saving...")
If VbCo ~=9 then do /*Dithering*/
dither(VbCo,xsize,ysize)
END
VbSf=save(dir,i,VbQual,VbSf,name) /*New VbSf in Case of Loader=Saver*/
pp_clearbuffer Buffer /*Nötig für w=0 Bildlade check*/
pp_setbuffer Buffer
END /*if vbActive=1*/
prog("Indexing...")
makehtml(xsize,ysize,ppz,tborder,VBImgB,i,dir,name,htmid,stellen,gesamt,counter,VbSf,vbActive)
Return 1
addslash: procedure
/*Adds trailling Slash*/
/**********************/
name=strip(arg(1))
if substr(name,length(name),1)=":" && substr(name,length(name),1)="/" THEN DO
Return name
END
name=name || "/"
return name
Dither: Procedure
/*Color Reducing*/
Colors=arg(1)
w= arg(2)
h= arg(3)
say dithering
say "colors= " colors
if colors=0 then DO
pp_EffectOn
pp_gray
pp_boxf 0 0 w h
pp_EffectOf
colors=8
END
pp_Convert2CMAP colors 0 /*1= Floyd*/
return colors
save: Procedure
/*Save the Image*/
/****************/
dir =arg(1)
name =arg(2)
qual =arg(3)
saveformat =arg(4)
Original =Arg(5)
/*Determining the real saveformat*/
/*********************************/
if SaveFormat=4 THEN DO /*Speicherformat=LadeFormat*/
if ~exists("PerfectPaint:Tools/Getimageinfo") THEN SaveFormat=0
if exists("PerfectPaint:Tools/Getimageinfo") THEN DO
ADDRESS COMMAND "PerfectPaint:Tools/GetImageInfo " || Original || " %f >t:PfAFormat"
Open(ForOut,"t:PfAFormat",r)
tmpFormat=readln(ForOut)
Close(ForOut)
Select
When tmpFormat="JPEG/JFIF" then Saveformat=0
When tmpFormat="PNG" then Saveformat=1
When tmpFormat="GIF89" then Saveformat=2
When tmpFormat="IFF-ILBM" then Saveformat=3
Otherwise DO
SaveFormat=0
say TmpFormat
END
END
END
END
format.0=".jpg"
format.1=".png"
format.2=".gif"
format.3=".iff"
name=dir || name || format.saveformat
/*Saving*/
/********/
if saveformat=0 then do
pp_SavePrefs 1 1 qual 0 0
pp_Save name 0
END
if SaveFormat=1 then DO
pp_SavePPM 't:PfPaint_Workfile.pnm'
pp_asay 'Making*PNG*file*|Please*wait*...'
ADDRESS COMMAND "Perfectpaint:Tools/pnmtopng t:PfPaint_Workfile.pnm >" || name
pp_closeAsay
ADDRESS COMMAND "delete t:pfpaint_workfile.pnm"
END
if saveformat=2 then do
pp_Render 0 'T:pptemp'
pp_asay 'Making*GIF*file|Please*wait*...'
address COMMAND 'perfectpaint:tools/tapgif '||'T:pptemp '||'"'|| name ||'"'
ADDRESS COMMAND 'delete >nil: T:pptemp'
pp_closeasay
end
if saveformat=3 then do
pp_SavePrefs 0 1
pp_Save name 0 /*IFF-ILBM*/
end
return SaveFormat
scale: Procedure
/*Thumbnail Scaling*/
/*******************/
buffer =arg(1)
thBuffer =Arg(2)
w =arg(3)
h =arg(4)
d =arg(5)
xsize =arg(6)
ysize =arg(7)
pp_SetBuffer thBuffer
pp_new w h d
pp_copyframe buffer
pp_scalepicture xsize ysize
return 0
ppload: Procedure
/*Check and load the Image*/
/**************************/
name =arg(1)
load=seekrep(name,' ','*')
say "teste " name
if exists(name) then DO
say Arg(1) " existiert!"
pp_load load
pp_GetHeight
h=result
pp_GetWidth
w=Result
pp_GetDepth
d=result
say "breite=" w
END
return h";"w";"d
smooth: Procedure
/*Button Rand*/
/*************/
x2 =arg(1)
y2 =arg(2)
x1 =0
y1 =0
pp_Updateundobox x1 y1 x2 y2
pp_clearrange 0
pp_ComposeReqOff
pp_EffectOn
a=1
b=3
size=4
PP_Gradient 0 1 /*Vertical*/
pp_SetRange 0 0 64 64 64
pp_setRange 0 19 0 0 0
pp_compose a 100 /*Add*/
pp_boxF x1 y1 x2 y1+size /*Oben*/
PP_Gradient 0 0 /*Horizontal*/
pp_BoxF x1 y1 x1+size y2 /*Links*/
PP_Gradient 0 1
pp_SetRange 0 0 0 0 0
pp_setRange 0 19 64 64 64 /*Invert Range*/
pp_Compose b 100 /*Sub*/
pp_BoxF x1 y2 x2 y2-size /*Unten*/
PP_Gradient 0 0 /*Horizontal*/
pp_BoxF x2 y1 x2-size y2 /*Rechts*/
/*Restore old*/
pp_ClearRange 0
pp_EffectOff
pp_Compose 0 100
return 0
SavePrefs: PROCEDURE
/*Preferences*/
/*************/
Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
if EXISTS(Prefname) THEN DO
ADDRESS COMMAND
'delete >nil: '||Prefname
END
IF OPEN('pfile',PrefName,'W') THEN DO
do i=2 to ARG()
CALL WRITELN('pfile',ARG(i))
end
CALL CLOSE('pfile')
RETURN
seekrep: Procedure
/*Seek and Replace*/
/******************/
string =Arg(1)
find =Arg(2)
replace =Arg(3)
l =length(find)
do while pos(find,string)~=0
p=pos(find,string)
string=insert(replace,delstr(string,p,l),p-1)
end
return string
makehtml: Procedure
/*Fullsize Image Page*/
/*********************/
xsize = arg(1)
ysize = arg(2)
ppz = arg(3)
tborder = arg(4)
outline = arg(5)
i = arg(6)
dir = arg(7)
name = arg(8)
htmid = arg(9)
stellen = arg(10)
gesamt = arg(11)
counter = Arg(12)
Saver = Arg(13)
vbActive= Arg(14)
format.0=".jpg"
format.1=".png"
format.2=".gif"
format.3=".iff"
open(in,htmid,"read")
open(out,dir || i || ".html","write")
input=readch(in,65500)
if vbActive=1 then throutput=htmlcomplete(input,name,xsize,ysize,outline,i,dir,0,0,tborder,stellen,gesamt,counter,format.saver,"yes")
ELSE throutput=htmlcomplete(input,name,xsize,ysize,outline,i,dir,0,0,tborder,stellen,gesamt,counter,format.saver,"no")
writech(out,throutput)
close(out)
close(in)
return 0
/*
%N : Name des Bildes
%w : Breite
%H : Höhe
%s : Size in bytes
%br : Bordersize (bild)
%tr : Bordersize (Tabelle)
%dr : Verzeichnis
%FW : Next html file
%BW : previous html file
%I : Laufnummer (Aktuelles bild)
*/
init:
pp_FindEmptyBuffer
Buffer=result
if Buffer=-1 then DO
pp_Warn "can't*find*empty|Buffer."
EXIT
END
/*Default Values*/
/****************/
dir ="Ram:"
sdir ="Ram:"
thsf =1
thqual =75
thmax =1
thxsize =220
thysize =160
vbsf =1
vbqual =75
vbmax =1
xsize =640
ysize =480
rotate =0
thali =1
thflipx =0
thsmooth =0
thflipy =0
vbali =0
vbflipx =0
vbsmooth =0
vbflipy =0
brush =0
BrushF =""
ppz =4
ThImgB =1
tborder =0
vbimgb =0
pinsel ="Nein"
httop ="Perfectpaint:KATalysator/def_html/plain/thTop"
htmid ="Perfectpaint:KATalysator/def_html/plain/fullsize"
htbot ="Perfectpaint:KATalysator/def_html/plain/thBottom"
rekursiv = 0
thActive=1
vbActive=1
zps= 0
ThCo = 9
VbCo = 9
Muster='~(#?.info)'
call setlang()
pp_verbose 0
return 0
loadprefs:
/*Voreinstellungen einladen*/
/***************************/
if EXISTS('PerfectPaint:Prefs/Rexx_Prefs/KATalysator') THEN DO
IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/KATalysator', "R") then DO
dir = seekrep(READLN('lfile')," ","*")
sdir = seekrep(READLN('lfile')," ","*")
ThSf = readln('lfile')
thQual = READLN('lfile')
ThMax = readln('lfile')
ThXSize=readln('lfile')
ThYSize=readln('lfile')
VbSf = readln('lfile')
VbQual= READLN('lfile')
VbMax = readln('lfile')
XSize = readln('lfile')
ySize = readln('lfile')
Rotate= readln('lfile')
ThAli = readln('lfile')
ThFlipX=readln('lfile')
ThSmooth=readln('lfile')
ThFlipY =readln('lfile')
VBAli =readln('lfile')
VbFlipX =readln('lfile')
VbSmooth=readln('lfile')
VbFlipY =readln('lfile')
Brush =readln('lfile')
BrushF =readln('lfile')
Pinsel=Platz.brush
ppz = READLN('lfile')
ThImgB = READLN('lfile')
tborder = READLN('lfile')
htmid = READLN('lfile')
VbImgB = READLN('lfile')
httop= Readln('lfile')
htbot= Readln('lfile')
rekursiv = readln('lfile')
thActive = readln('lfile')
vbActive = readln('lfile')
ZpS = readln('lfile')
ThCo = readln('lfile')
VbCo = readln('lfile')
Muster = readln('lfile')
CALL CLOSE('lfile')
END
END
return 0
setlang:
/*Sprache für GUI Initialisieren*/
/********************************/
pp_getlocale 1
if result="Öffnen" then DO /*Deutsch*/
gui_titel1 = "Thumbnail"
gui_titel2 = "Vollbild"
gui_quelle = "****Quell*Verzeichnis"
gui_rekursiv = "mit*Unterverz."
gui_filter = "Namensmuster"
gui_ziel = "*****Ziel*Verzeichnis"
gui_sformat = "******Speicher*Format"
gui_JPGquali = "********JPEG*Qualität"
gui_imageb = "*******Bildrand-Größe"
gui_IMGsize = "***Fit*in*Box*/*Größe"
gui_rotation = "***************Drehen"
gui_intpol = "*********AntiAliasing"
gui_softb = "*********weicher*Rand"
gui_FlipX = "Flip*x"
gui_FlipY = "Flip*y"
gui_insertb = "******Pinsel*einfügen"
Platz.1 = "Nein"
Platz.0 = "Oben*links"
Platz.10 = "Oben*mitte"
Platz.20 = "Oben*rechts"
Platz.3 = "Mitte*Links"
Platz.13 = "Mitte*mitte"
Platz.23 = "Mitte*rechts"
Platz.6 = "Unten*links"
Platz.16 = "Unten*mitte"
Platz.26 = "Unten*rechts"
gui_htmlpref = "HTML*Einstellungen"
gui_file = "****************Datei"
gui_tableb = "***Tabellenrand-Größe"
gui_BproZ = "*****Bilder*pro*Zeile"
gui_BproS = "****Bilder*pro*Spalte"
gui_header = "***********Kopf-Datei"
gui_body = "*******Vollbild-Datei"
gui_foot = "************Fuß-Datei"
gui_ThHTML1 = "***********Kopf-Datei"
gui_ThHTML2 = "************Fuß-Datei"
gui_VbHTML1 = "*******Kopf/Fuß-Datei"
gui_brush1="Pinsel*wo*einfügen?"
gui_colors = "***************Farben"
END
ELSE DO
gui_titel1 = "Thumbnail"
gui_titel2 = "Image"
gui_quelle = "*****Source*Directory"
gui_rekursiv = "with*Subdirs"
gui_filter = "File*Pattern"
gui_ziel = "*****Destination*Dir."
gui_sformat = "**********Save*Format"
gui_JPGquali = "*********JPEG*quality"
gui_imageb = "*****Imageborder-Size"
gui_IMGsize = "****Fit*in*Box*/*Size"
gui_rotation = "***************Rotate"
gui_intpol = "*********AntiAliasing"
gui_softb = "**********Soft-Border"
gui_FlipX = "Flip*x"
gui_FlipY = "Flip*y"
gui_insertb = "*********Insert*Brush"
Platz.1 = "No"
platz.0 = "Upper*Left"
Platz.10 = "Upper*Center"
Platz.20 = "Upper*Right"
Platz.3 = "Middle*Left"
Platz.13 = "Middle*Center"
Platz.23 = "Middle*Right"
Platz.6 = "Lower*Left"
Platz.16 = "Lower*Center"
Platz.26 = "Lower*Right"
gui_htmlpref = "HTML*Config"
gui_file = "*****************File"
gui_tableb = "*****Tableborder-Size"
gui_BproZ = "*******Images*per*row"
gui_BproS = "*******Images*per*col"
gui_ThHTML1 = "************Head-File"
gui_ThHTML2 = "************Foot-File"
gui_VbHTML1 = "*******Head/Foot-File"
gui_brush1="Insert*Brush*where?"
gui_colors = "***************Colors"
END
return 0
opengui:
DO UNTIL Rr>-1
setlang()
/* GUI main window */
pp_DialogInit 462 349 "*KATalysator***©*by*Markus*Castro*&*Antibike" 60
pp_group 0 151 28 160 23 0
pp_checkbox 51 145 6 20 16 "" 2 ThActive
pp_text 1 190 22 gui_titel1 1
pp_group 2 313 28 160 23 0
pp_checkbox 52 307 6 20 16 "" 2 VbActive
pp_text 3 360 22 gui_titel2 2
pp_group 4 10 53 139 61 0
pp_text 5 2 48 gui_quelle
pp_text 6 2 82 gui_ziel
pp_group 7 151 53 322 61 0
pp_string 8 145 30 160 16 "" 1 100 sdir
pp_getfile 9 305 31 8 gui_quelle 1 sdir
pp_checkbox 53 334 32 20 16 "" 2 Rekursiv
pp_text 54 370 48 gui_rekursiv 2
pp_string 58 145 47 160 16 "" 1 100 Muster
pp_text 59 314 65 gui_filter 2
pp_string 10 145 64 285 16 "" 1 100 dir
pp_getfile 11 430 65 10 gui_ziel 1 dir
pp_group 12 10 115 139 207 0
pp_text 13 2 110 gui_sformat
pp_text 14 2 127 gui_JPGquali
pp_text 55 2 147 gui_colors
pp_text 15 2 166 gui_IMGsize
pp_text 16 2 212 gui_rotation
pp_text 17 2 235 gui_intpol
pp_text 18 2 247 gui_softb
pp_text 19 2 270 gui_insertb
pp_text 20 2 287 gui_file
pp_group 21 151 115 160 101 0
PP_Cycle 22 145 92 108 16 "" 1 "JPG|PNG|GIF|IFF|Loader" ThSf
pp_slider 23 145 109 108 16 "" 1 1 100 ThQual
PP_Cycle 56 145 129 108 16 "" 1 "8bit*Grey|2|4|8|16|32|64|128|256|24bit" ThCo
pp_checkbox 24 145 151 20 16 "" 2 ThMax
pp_string 25 178 149 75 16 "x" 2 10 thXSize
pp_string 26 178 166 75 16 "y" 2 10 thYSize
pp_group 27 313 115 160 101 0
PP_Cycle 28 307 92 108 16 "" 1 "JPG|PNG|GIF|IFF|Loader" VbSf
pp_slider 29 307 109 108 16 "" 1 1 100 VbQual
PP_Cycle 57 307 129 108 16 "" 1 "8bit*Grey|2|4|8|16|32|64|128|256|24bit" VbCo
pp_checkbox 30 307 151 20 16 "" 2 VbMax
pp_string 31 340 149 75 16 "x" 2 10 XSize
pp_string 32 340 166 75 16 "y" 2 10 YSize
pp_group 33 151 217 322 26 0
pp_cycle 34 145 194 305 16 "" 1 "0°|90°|180°|270°" rotate
pp_group 35 151 244 160 33 0
pp_checkbox 36 145 221 20 16 "" 0 ThAli
pp_checkbox 37 207 221 20 16 gui_FlipX 2 ThFlipX
pp_checkbox 38 145 234 20 16 "" 0 ThSmooth
pp_checkbox 39 207 234 20 16 gui_FlipY 2 ThFlipY
pp_group 40 313 244 160 33 0
pp_checkbox 41 307 221 20 16 "" 0 VbAli
pp_checkbox 42 370 221 20 16 gui_FlipX 2 VbFlipX
pp_checkbox 43 307 234 20 16 "" 0 VbSmooth
pp_checkbox 44 370 234 20 16 gui_FlipY 2 VbFlipY
pp_group 45 151 278 322 44 0
pp_button 46 145 255 305 16 pinsel
pp_string 47 145 272 285 16 "" 1 100 BrushF
pp_getfile 48 430 273 47 gui_insertb 0 BrushF
pp_group 49 10 324 463 26 0
pp_Button 50 127 301 200 16 gui_htmlpref
pp_Dialog
/* GUI main window end */
rr=result
say rr
if rr=0 then
do
pp_permitrefresh
EXIT
end
call getvalues()
if rr=-50 then DO until retu=1 | retu=0
/* GUI html config */
pp_DialogInit 462 254 gui_htmlpref 30
pp_group 0 10 28 463 23 1
pp_text 1 10 22 gui_titel1 1
pp_group 2 10 53 139 118 0
pp_text 5 2 49 gui_BproZ
pp_text 3 2 85 gui_Imageb
pp_text 4 2 103 gui_tableb
pp_text 6 2 121 gui_ThHTML1
pp_group 7 151 53 322 118 0
pp_slider 8 145 30 270 16 "" 1 1 10 ppz
pp_slider 9 145 66 270 16 "" 1 0 10 ThImgb
pp_slider 10 145 84 270 16 "" 1 0 10 tborder
pp_string 11 145 102 250 16 "" 1 100 httop
pp_getfile 12 395 103 11 gui_ThHTML1 0 httop
pp_button 13 420 103 32 14 "Edit"
pp_group 14 10 181 463 23 1
pp_text 15 10 175 gui_titel2 1
pp_group 16 10 206 139 45 0
pp_text 17 2 202 gui_Imageb
pp_text 18 2 220 gui_VbHTML1
pp_text 19 2 139 gui_ThHTML2
pp_group 20 151 206 322 45 0
pp_slider 21 145 183 270 16 "" 1 0 10 VbImgb
pp_string 22 145 201 250 16 "" 1 100 htmid
pp_getfile 23 395 202 22 gui_VbHTML1 0 htmid
pp_button 24 420 202 32 14 "Edit"
pp_text 25 2 67 gui_BproS
pp_slider 26 145 48 270 16 "" 1 0 10 zps /*Zeilen Pro Seite*/
pp_string 27 145 121 250 16 "" 1 100 htbot
pp_getfile 28 395 122 27 gui_ThHTML2 0 htbot
pp_button 29 420 122 32 14 "Edit"
pp_Dialog
/* GUI html config end */
retu=result
if retu~=0 then do
call gethtmlvalues
end
say "retu = " retu
say htmid
if retu=-13 then DO
ADDRESS COMMAND "sys:tools/editpad " || httop
END
if retu=-23 then DO
ADDRESS COMMAND "sys:tools/editpad " || htmid
END
if retu=-29 then DO
ADDRESS COMMAND "sys:tools/editpad " || htbot
END
END /*HTML Until*/
if rr=-46 then DO
return=BrushAsk(gui_brush1)
Parse Var return,posi";"Platz
pinsel=platz
brush=posi
END
END /*Until*/
return 0
gethtmlvalues:
pp_getdialog 8
ppz=result
pp_getdialog 9
thimgb=result
pp_getdialog 10
thborder=result
pp_getdialog 11
httop=result
pp_getdialog 21
vbimgb=result
pp_getdialog 22
htmid=result
pp_getdialog 26
ZpS = result /*Zeilen Pro Seite*/
pp_getdialog 27
htbot=result
return 0
getvalues:
pp_Getdialog 8
sdir=addslash(seekrep(upper(result),"RAM DISK:","Ram:"))
pp_GetDialog 10
dir=result
dir=addslash(seekrep(upper(result),"RAM DISK:","Ram:"))
pp_getdialog 22
ThSf=result
pp_getdialog 23
ThQual=result
pp_getdialog 24
thmax=result
pp_getdialog 25
thxsize=result
pp_getdialog 26
thysize=result
pp_getdialog 28
vbsf=result
pp_getdialog 29
vbqual=result
pp_getdialog 30
vbmax=result
pp_getdialog 31
xsize=result
pp_getdialog 32
ysize=result
pp_getdialog 34
rotate=result
pp_getdialog 36
thali=result
pp_getdialog 37
thflipx=result
pp_getdialog 38
thsmooth=result
pp_getdialog 39
thflipy=result
pp_getdialog 41
vbali=result
pp_getdialog 42
vbflipx=result
pp_getdialog 43
vbsmooth=result
pp_getdialog 44
vbflipy=result
pp_Getdialog 47
BrushF = result
if brushF="" then do
Brush=1
END
pp_Getdialog 29
saveformat=result
if saveformat=2 then do
pp_RenderReq 0
END
pp_getdialog 51
ThActive= Result
pp_getdialog 52
VbActive= Result
pp_getdialog 53
rekursiv= result
pp_getdialog 56
ThCo = Result
pp_getdialog 57
VbCo = Result
pp_getdialog 58
muster=result
return 0
brushask:
/*Pinsel Position*/
/*****************/
pp_Placegui arg(1)
posi=abs(result)
return posi";"Platz.posi
BrushPlot: Procedure
/*Pinsel einfügen*/
/*****************/
Brush =arg(1)
Pos =arg(2)
w =arg(3)
h =arg(4)
pp_setBrush Brush
pp_getheightb
bh=result
pp_getwidthb
bw=result
Select
WHEN pos=0 then DO
x=bw/2
y=bh/2
END
WHEN pos=10 then DO
x=w/2
y=bh/2
END
WHEN pos=20 then DO
x=w-bw/2
y=bh/2
END
WHEN pos=3 then DO
x=bw/2
y=h/2
END
WHEN pos=13 then DO
x=w/2
y=h/2
END
WHEN pos=23 then DO
x=w-bw/2
y=h/2
END
WHEN pos=6 then DO
x=bw/2
y=h-bh/2
END
WHEN pos=16 then DO
x=w/2
y=h-bh/2
END
WHEN pos=26 then DO
x=w-bw/2
y=h-bh/2
END
OTHERWISE NOP
END
say "plotx=" x
say "ploty=" y
pp_plot x y
Return 0
BrushInit: Procedure
/*Pinsel einladen*/
/*****************/
brushf =arg(1)
pp_FindEmptyBrush
Brush=result
if Brush=-1 then DO
pp_Warn "can't*find*empty|Brush."
EXIT
END
pp_Setbrush Brush
pp_Bload BrushF
return Brush
indexinit: procedure
/*Index anlegen/abschließen*/
/***************************/
ppz =arg(1) /*Bilder pro Zeile*/
tborder=arg(2) /*Tabellen Rand*/
outline=arg(3) /*Image Rand*/
thw =arg(4)
thh =arg(5)
w =arg(6)
h =arg(7)
name =arg(8) /*Name des Bildes*/
dir =arg(9)
i =value(arg(10))
file =arg(11)
mode =arg(12)
stellen=arg(13)
saver =Arg(14)
format.0=".jpg"
format.1=".png"
format.2=".gif"
format.3=".iff"
open(infile,file,read)
open(index,dir || "index.html",mode)
line=readch(infile,65500)
out=htmlcomplete(line,name,w,h,outline,i,dir,thw,thh,tborder,stellen,1,2,format.aver)
writeln(index,out)
close(index)
close(infile)
return 0
indexmake: procedure
/*Thumbnails*/
/************/
ppz =arg(1)
tborder =arg(2)
outline =arg(3)
thw =arg(4)
thh =arg(5)
xsize =arg(6)
ysize =arg(7)
name =arg(8)
dir =arg(9)
i =value(arg(10))
stellen =arg(11)
saver =arg(12)
thActive =arg(13)
say "indexmake, thumbnails, i=" i
if thActive=1 then line='<TD><A HREF="%I.html"><IMG SRC="th%I' || saver || '" BORDER=%BR WIDTH=%THW HEIGHT=%THH></A><BR><BR><FONT SIZE=-1>%N<BR>(%W x %H)</FONT></TD>'
ELSE do
Line = '<TD><FONT SIZE=-1><A HREF=%I.html>%N</A></FONT></TD>'
name=aufteilen(name)
end
open(index,dir || "index.html","append")
out=htmlcomplete(line,name,xsize,ysize,outline,i,dir,thw,thh,tborder,stellen,1,2,saver,vbactive)
writeln(index,out)
say "ppz=" ppz
if (i // ppz) = 0 then do
writeln(index,"</TR>")
writeln(index,"<TR ALIGN=CENTER>")
END
close(index)
return 0
htmlcomplete: Procedure
/*Seek&Replace %Values*/
/**********************/
var =arg(1)
name =arg(2)
w =arg(3)
h =arg(4)
outline =arg(5)
i =value(arg(6))
dir =arg(7)
thw =arg(8)
thh =arg(9)
tborder =arg(10)
stellen =arg(11)
gesamt =arg(12)-1
counter =arg(13)
format =arg(14)
vbactive=arg(15)
say "Counter/ Gesamt=" Counter " " Gesamt
throutput=seekrep(var,"%N",name)
throutput=seekrep(throutput,"%W",w)
throutput=seekrep(throutput,"%H",h)
throutput=seekrep(throutput,"%BR",outline) /*Bildrand*/
throutput=seekrep(throutput,"%TBR",tborder) /*Tabellenrand*/
if vbactive="yes" then throutput=seekrep(throutput,"%I",i || format)
if vbactive="no" then throutput=seekrep(throutput,"%I","file:///" || name)
if vbactive="VBACTIVE" then throutput=seekrep(throutput,"%I",i)
throutput=seekrep(throutput,"%DR",DIR)
throutput=seekrep(throutput,"%FO",Format) /*Bild Format*/
if counter=1 then DO
throutput=seekrep(throutput,"%BW","index.html")
END
ELSE DO
throutput=seekrep(throutput,"%BW",right(value(i)-1,stellen,"0") || ".html")
END
if counter=gesamt then DO
throutput=seekrep(throutput,"%FW","index.html")
END
ELSE DO
throutput=seekrep(throutput,"%FW",right(i+1,stellen,"0") || ".html")
END
throutput=seekrep(throutput,"%THW",thw)
throutput=seekrep(throutput,"%THH",thh)
return throutput
countlines: Procedure
/*Anzahl Bilder feststellen*/
/***************************/
name =arg(1)
file =arg(2)
open(name,name,r)
i=0
do while ~eof(name)
x=readln(name)
i=i+1
END
close(out)
return i/*-1*/ /*Zwei Leerzeilen am ende ignorieren...*/
piccheck: Procedure
/*Obsolete*/
/**********/
pic=seekrep(arg(1),"Ram Disk:","Ram:")
/*if exists("Perfectpaint:tools/getimageinfo") then DO
ADDRESS COMMAND 'Perfectpaint:Tools/getimageinfo %f >t:picstate ' || pic
open(file,"t:picstate",r)
y=readln(file)
say y
close(file)
if y="???" | word(y,1)="ERROR:" then dO
state=0
END
ELSE DO
State=1
END
END
ELSE DO
state=1
END
say "Bild " pic " hat state= " state
*/
return state
Aufteilen: PROCEDURE
zeile=arg(1)
/*Aufteilung in Pfad und Datei*/
size=length(Zeile)
stelle=lastpos("/",Zeile)
if stelle=0 then stelle=lastpos(":",Zeile)
datei=right(Zeile,size-stelle)
RETURN datei
checkHhtmlFiles:
initvars()
/*Check for Existance of HTML Templates*/
/***************************************/
if ~exists(httop) then DO
httop = "t:Pf_Album_Top"
open(top,httop,w)
writech(top,htmltop)
end
close(top)
if ~exists(htbot) then DO
htbot = "t:Pf_Album_Bottom"
open(bot,htot,w)
writech(bot,htmlbottom)
end
close(bot)
if ~exists(htmid) then DO
htmid = "t:Pf_Album_mid"
open(mid,htmid,w)
writech(mid,htmlFs)
end
close(mid)
return 0
initvars:
htmltop= '<HTML>
<HEAD>
<TITLE>HTML Index created by Perfect Album</TITLE>
<!-- This page was created with KATalysator, © by Saint -->
</HEAD>
<BODY BGCOLOR=#FFFFFF>
<TABLE BORDER=%TBR CELLPADDING=2 CELLSPACING=1>
'
htmlBottom= '</TR>
</TABLE><BR>
<CENTER><FONT SIZE=-1>Made with KATalysator © by Saint & Antibike</FONT></CENTER>
</BODY>
</HTML>'
HtmlFs = ' <HTML>
<HEAD>
<TITLE>%N</TITLE>
<!-- This page was created with KATalysator © by Saint & Antibike -->
</HEAD>
<BODY BGCOLOR=#FFFFFF>
<CENTER><FONT SIZE=3>%N (%W x %H)</FONT>
<BR><BR>
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=1>
<TR>
<TD><FONT SIZE=-1><A HREF="%BW">Previous</A></TD>
<TD><FONT SIZE=-1><A HREF="index.html">Overview</A></TD>
<TD><FONT SIZE=-1><A HREF="%FW">Next</A></TD>
</TR>
<TR>
<TD COLSPAN=3><center><FONT SIZE=-1><A HREF="file:///%N">Original</A></CENTER></TD>
</TR>
</TABLE>
<BR><BR>
<IMG SRC="%I" BORDER=%BR WIDTH=%W HEIGHT=%H ALT="%N">
</BODY>
</HTML>'
return 0
prog: /*Sets the Progressing*/
text=arg(1)
pp_progresstext text
say "counter bildre" getclip("counter") getclip("bilder")
pp_progress getclip("counter") getclip("bilder")
return 0